﻿namespace GeneticSharpDemo.Models
{
    /// <summary>
    /// 模型编码的列表
    /// </summary>
    public class JobAndProc
    {
        public int Index { get; set; }
        public JobInfo JobInfo { get; set; }
        public Proc Proc { get; set; }
        public Proc PreProc { get; set; }
        public int ProcTime => JobInfo.ProcInfos[Proc.Index].Time;
        public string ProcTrackName => JobInfo.ProcInfos[Proc.Index].TrackName;
        public int ProcStartTime => JobInfo.ProcInfos[Proc.Index].StartTime;
        public int ProcEndTime => JobInfo.ProcInfos[Proc.Index].EndTime;
        public int PreProcTime => PreProc == null ? 0 : JobInfo.ProcInfos[PreProc.Index].Time;

        public override string ToString()
        {
            return $"{JobInfo}-{Proc}-{ProcTime}-{PreProc}";
        }
    }
}